"""定义learning_logs模块的urls"""

from django.conf.urls import url
from . import views

urlpatterns = [
    url(r"^$",views.index,name="index"),
    url(r"^topics/$",views.topics,name="topics"),
    #url(r"^topic/(\d+)$",views.topic,name="topic"), #这个url设置比较简单 这是一种定义参数的方式
    url(r"^topic/(?P<id>\d+?)",views.topic,name="topic"), #这个url的设置和上面的效果一样 不过指定了参数名为 id 对应视图函数的参数名要一致
    url(r"^new_topic/$",views.new_topic,name="new_topic"),
    url(r"^new_entry/(\d+)$",views.new_entry,name="new_entry"),
    url(r"^edit_entry/(\d+)$",views.edit_entry,name="edit_entry"),
    url(r"^add_comment/(\d+)$",views.add_comment,name="add_comment"),
    url(r"^comment/(\d+)$",views.comment,name="comment"),

] 